package cn.bytecollege.admin.dao;

import cn.bytecollege.common.dao.BaseDao;
import cn.bytecollege.common.entity.Admin;

import java.util.List;

public class AdminDao extends BaseDao<Admin,Integer> {

    public Admin findByUsername(String username){
        String sql = "SELECT ADMIN_ID,ADMIN_NAME,ADMIN_PASSWORD FROM ADMIN WHERE ADMIN_NAME = ?";
        List<Admin> list = helper.executeQuery(sql,Admin.class,username);
        Admin admin = null;
        if(list.size()>0){
            admin = list.get(0);
        }
        return  admin;
    }
}
